<template>
  <div class="cardform">
    <el-form ref="form" :model="form" label-width="120px" label-position="top">
      <el-form-item label="CardNotice Title" label-width="200px">
        <el-input
          v-model="form.name"
          placeholder="Please input the title"
        ></el-input>
      </el-form-item>
      <el-form-item label="CardNotice Content" label-width="200px">
        <el-input
          v-model="form.desc"
          type="textarea"
          :rows="10"
          placeholder="Please input the content"
        ></el-input>
      </el-form-item>
      <el-form-item label="Urgency">
        <el-radio-group v-model="form.resource" size="medium" fill="grey">
          <el-radio-button label="unusually urgent" border></el-radio-button>
          <el-radio-button label="General emergency" border></el-radio-button>
          <el-radio-button label="Common" border></el-radio-button>
        </el-radio-group>
      </el-form-item>
      <el-form-item>
        <el-button type="info" @click="onSubmit">Submit</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import { ElMessage } from "element-plus";
export default {
  data() {
    return {
      form: {
        name: "",
        region: "",
        date1: "",
        date2: "",
        delivery: false,
        type: [],
        resource: "",
        desc: "",
      },
    };
  },
  methods: {
    onSubmit() {
      console.log("submit!");
      ElMessage({
        message: "Submited Successfully!",
        type: "success",
        center: true,
      });
    },
  },
};
</script>

<style scoped>
.cardform {
  border: 1px dotted lightgray;
  border-radius: 8px;
}
</style>
